﻿using AutoMapper;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace NETCORE.TAutoMappper.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        public IMapper Mapper;
        public ValuesController(IMapper mapper)
        {
            Mapper = mapper;
        }

        [HttpGet]
        [Route("testc")]
        public void testc()
        {
            var studentDto = new StudentDto() { Id = 1, Name = "张三", gender = false };
            var studentModel = Mapper.Map<StudentModel>(studentDto);


            var sModel = new StudentModel() { Id = 2, Name = "李四", age = 22 };
            var sDto = Mapper.Map<StudentDto>(sModel);
        }
    }
}



